package com.example.wanandroid_copy2.ui.collect.viewmodel

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.example.wanandroid_copy2.common.BaseResponse
import com.example.wanandroid_copy2.common.BaseViewModel
import com.example.wanandroid_copy2.ui.article.viewmodel.ArticleViewModel
import com.example.wanandroid_copy2.ui.collect.data.model.CollectRsp
import com.example.wanandroid_copy2.ui.collect.data.repository.CollectRepository

class CollectViewModel(application: Application) : ArticleViewModel<CollectRepository>(application) {

    val mConnectArticleData : MutableLiveData<BaseResponse<CollectRsp>> = MutableLiveData()
    val mUnConnectArticleData :MutableLiveData<BaseResponse<Any>> = MutableLiveData()

    fun getCollectArticles(page :Int){
        mRepository.getCollectArticles(page,mConnectArticleData)
    }

    fun unCollect(id : Int,originId : Int){
        mRepository.unCollect(id,originId,mUnConnectArticleData)
    }

}